import React, { Component } from 'react'
import MyNavLink from '../../components/Layout/MyNavLink'
import { Route, Switch, Redirect } from 'react-router-dom'
import Message from './Message'
import News from './News'
import './index.css'

export default class Home extends Component {
  render() {
    return (
      <div className="home">
        <div className="home-tab">
          <MyNavLink to="/home/news">News</MyNavLink>
          <MyNavLink to="/home/message">Message</MyNavLink>
        </div>
        <div className='home-content'>
          <Switch>
            <Route path="/home/news" component={News} />
            <Route path="/home/message" component={Message} />
            <Redirect to="/home/news" />
          </Switch>
        </div>
      </div>
    )
  }
}
